<?php

namespace App\Traits\Controllers;

Trait AdminTraits
{
    //查看
    use IndexTraits;
    //详情
    use ShowTraits;
    //更改
    use UpdateTraits;
    //删除
    use DestroyTraits;
    //保存
    use StoreTraits;

    /**
     * 实现方法重载
     *
     * @param string $method
     * @param array $parameters
     * @return mixed|void
     */
    public function __call($method, $parameters)
    {
        try {
            $this->{$method}(...$parameters);
        } catch (\Exception $exception) {
            throw new \BadMethodCallException(sprintf(
                'Method %s::%s does not exist.', static::class, $method
            ));
        }
    }
}
